package com.example.javabasic.thread.classtwo.activeobject.demo1;

/**
 *  将activeObjects 的方法转化为 Reqeust对象  MethodRequest 抽象类用于扩展,
 */
public class DisplayStringRequest extends MethodRequest {

    private final String text;


    public DisplayStringRequest(Servant servant, final String text) {
        super(servant, null);
        this.text = text;
    }


    @Override
    public void execute() {
        this.servant.displayString(text);
    }
}
